import React from 'react';
import { View, Text, Image, StyleSheet } from 'react-native';
import { COLORS, SHADOWS } from '../styles/constants';

export default function PlaceCard({ cover, title, subtitle }) {
  return (
    <View style={styles.card}>
      <Image source={cover} style={styles.cover} resizeMode="cover" />
      <View style={styles.info}>
        <Text numberOfLines={1} style={styles.title}>
          {title}
        </Text>
        {subtitle ? (
          <Text numberOfLines={1} style={styles.subtitle}>
            {subtitle}
          </Text>
        ) : null}
      </View>
    </View>
  );
}

const styles = StyleSheet.create({
  card: {
    width: 160,
    borderRadius: 12,
    backgroundColor: COLORS.background.card,
    overflow: 'hidden',
    marginRight: 12,
    ...SHADOWS.sm,
  },
  cover: {
    width: '100%',
    height: 100,
    backgroundColor: COLORS.background.secondary,
  },
  info: { padding: 10 },
  title: { fontSize: 14, fontWeight: '600', color: COLORS.text.primary },
  subtitle: { marginTop: 4, fontSize: 12, color: COLORS.text.tertiary },
});
